package com.bbz.core.bloomfilter;

import java.util.HashSet;
import java.util.Random;

import com.sangupta.bloomfilter.BloomFilter;

public class TestBloomFilter {

	private final String[] URLS = { "http://www.csdn.net/", "http://www.baidu.com/", "http://www.google.com.hk",
			"http://www.cnblogs.com/", "http://www.zhihu.com/", "https://www.shiyanlou.com/",
			"http://www.google.com.hk", "https://www.shiyanlou.com/", "http://www.csdn.net/" };

	private void testBloomFilter() {
		BloomFilterDemo filter = new BloomFilterDemo();
		for (int i = 0; i < URLS.length; i++) {
			if (filter.contains(URLS[i])) {
				System.out.println("contain: " + URLS[i]);
				continue;
			}

			filter.add(URLS[i]);
		}
	}

	public static void main(String[] args) {
		TestBloomFilter t = new TestBloomFilter();
		t.testBloomFilter();
	}
}
